home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 191 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
  3. Newsgroups: comp.std.c++
  4. Subject: Incompatibility C++ <-> ANSI-C
  5. Date: 30 Jan 1996 15:45:35 GMT
  6. Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4ekpnj$h7q@fsuj01.rz.uni-jena.de>
  9. Reply-To: mkt@isun04.inf.uni-jena.de
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Type: text
  12. X-Nntp-Posting-Host: isun07.inf.uni-jena.de
  13. Content-Length: 410
  14. X-Lines: 16
  15. Originator: clamage@taumet
  16.  
  17. Does the operator ?: an itegral promotion on its
  18. second and third operand in C++?
  19. I cannot find the answer in the ARM. (I think it says: no)
  20.  
  21. Consider this:
  22. char x, y;
  23. Which type has the following expression:
  24. (a ? x : y)
  25.  
  26. In ANSI-C the type is clearly an 'int' (or 'unsigned').
  27. But the type in C++ is 'char'???
  28.  
  29. Even different compilers have different results!
  30. (Borland 3.1: 'char', SPARCompiler 4.0: 'int')
  31.  
  32.  
  33.  
  34. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  35.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  36.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  37.  
  38.